﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};
	
	var auditData = Jxstar.findComboData('audit');
	var moneytypeData = Jxstar.findComboData('moneytype');
	var authtypeData = Jxstar.findComboData('authtype');
	var paytypeData = Jxstar.findComboData('paytype');
	var htstatusData = Jxstar.findComboData('htstatus');
	var items = [{
		width:'97%',
		border:false,
		layout:'form',
		autoHeight:true,
		xtype:'container',
		style:'padding:5 10 5 10;',
		items:[{
			anchor:'100%',
			border:false,
			xtype:'container',
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				xtype:'container',
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textfield', fieldLabel:'项目编号', name:'contract__project_code', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'项目名称', name:'contract__project_name', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'项目批复金额(万元)', name:'contract__project_money', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'textfield', fieldLabel:'项目负责人', name:'contract__project_user', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'合同编号', name:'contract__contract_code', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'trigger', fieldLabel:'甲方单位', name:'contract__company_dept',
						anchor:'100%', triggerClass:'x-form-search-trigger',
						maxLength:50, allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', editable:false,
						onTriggerClick: function() {
							var selcfg = {pageType:'combogrid', nodeId:'sys_dept1', layoutPage:'', sourceField:'', targetField:'', whereSql:"", whereValue:'', whereType:'', isSame:'1', isShowData:'1', isMoreSelect:'0',isReadonly:'1',queryField:'',likeType:'',fieldName:'contract.company_dept'};
							JxSelect.createSelectWin(selcfg, this, 'node_contract_sign_fac_form');
						}},
					{xtype:'textfield', fieldLabel:'乙方单位', name:'contract__provider_name', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'textfield', fieldLabel:'开户银行', name:'contract__bank_name', anchor:'100%', maxLength:50},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'合同金额(万元)', name:'contract__contract_money', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%', maxLength:12},
					{xtype:'datefield', fieldLabel:'合同送审日期', name:'contract__send_date', format:'Y-m-d', anchor:'100%'},
					{xtype:'datefield', fieldLabel:'审计通过日期', name:'contract__pass_date', format:'Y-m-d', anchor:'100%'},
					{xtype:'datefield', fieldLabel:'要求完工日期', name:'contract__finish_date', format:'Y-m-d', anchor:'100%'},
					{xtype:'numberfield', allowDecimals:false, fieldLabel:'质保期(月)', name:'contract__quality_month', anchor:'100%', maxLength:12},
					{xtype:'datefield', fieldLabel:'合同有效期', name:'contract__contract_date', format:'Y-m-d', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'项目ID', name:'contract__project_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'主键', name:'contract__contract_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'供应商ID', name:'contract__provider_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'是否厂内合同', name:'contract__is_factory', defaultval:'1', anchor:'100%'}
				]
			},{
				border:false,
				xtype:'container',
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'combo', fieldLabel:'记录状态', name:'contract__audit_up', defaultval:'0',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: auditData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: auditData[0][0]},
					{xtype:'combo', fieldLabel:'项目类别', name:'contract__money_type',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: moneytypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: moneytypeData[0][0]},
					{xtype:'combo', fieldLabel:'授权形式', name:'contract__auth_type',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: authtypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: authtypeData[0][0]},
					{xtype:'textfield', fieldLabel:'实施单位', name:'contract__dept_name', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'textfield', fieldLabel:'合同名称', name:'contract__contract_name', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'textfield', fieldLabel:'甲方经办人', name:'contract__company_user', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'乙方经办人', name:'contract__provider_user', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'银行账号', name:'contract__bank_account', anchor:'100%', maxLength:50},
					{xtype:'datefield', fieldLabel:'合同签订日期', name:'contract__write_date', format:'Y-m-d', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%'},
					{xtype:'combo', fieldLabel:'付款方式', name:'contract__settle_type',
						anchor:'100%', editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: paytypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: paytypeData[0][0]},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'已付款金额(万元)', name:'contract__pay_money', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'datefield', fieldLabel:'验收日期', name:'contract__check_date', format:'Y-m-d', anchor:'100%', readOnly:true},
					{xtype:'combo', fieldLabel:'合同状态', name:'contract__contract_status',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: htstatusData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: htstatusData[0][0]},
					{xtype:'textfield', fieldLabel:'合同签订部门', name:'contract__done_deptname', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'hidden', fieldLabel:'实施单位ID', name:'contract__dept_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'项目负责人ID', name:'contract__project_userid', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'合同创建日期', name:'contract__creat_date', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'合同签订部门ID', name:'contract__done_deptid', anchor:'100%'}
				]
			}
			]
		},{
			anchor:'100%',
			border:false,
			xtype:'container',
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				xtype:'container',
				columnWidth:0.99,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textarea', fieldLabel:'工作概述', name:'contract__work_profile', width:'100%', height:48, maxLength:200},
					{xtype:'textarea', fieldLabel:'费用及计算', name:'contract__cost', width:'100%', height:48, maxLength:200},
					{xtype:'textarea', fieldLabel:'条款审查', name:'contract__article_check', width:'100%', height:48, maxLength:500},
					{xtype:'textarea', fieldLabel:'备注', name:'contract__memo', width:'100%', height:48, maxLength:200}
				]
			}
			]
		}]
	}];
	
	config.param = {
		items: items,
		funid: 'contract_sign_fac'
	};

	
	config.eventcfg = {		//初始化页面数据		initOther : function() {			var myform = this.form;			var chkdate = myform.get("contract__write_date");			if (chkdate == null || chkdate.length == 0) {				myform.set("contract__write_date", JxDefault.getToday());			}						var username = myform.get("contract__company_user");			if (username == null || username.length == 0) {				myform.set("contract__company_user", JxDefault.getUserName());			}						var deptname = myform.get("contract__company_dept");			if (deptname == null || deptname.length == 0) {				myform.set("contract__company_dept", JxDefault.getOrgName());			}		}	};
	
	return new Jxstar.FormNode(config);
}